package com.canyou.integration;

import lombok.Getter;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;

import java.util.Collection;

/**
 * Jwt用户
 *
 * @author cgz
 * @date 2018-12-07
 */
public class IntegrationUserDetails extends User {

    private static final long serialVersionUID = 2017845963758421135L;

    public IntegrationUserDetails(Long userId, String username, String password, boolean enabled,
                                  boolean accountNonLocked,
                                  Collection<? extends GrantedAuthority> authorities) {
        super(username, password, enabled, true, true,
                accountNonLocked, authorities);
        this.userId = userId;
    }

    @Getter
    private Long userId;
}
